package com.suray.system.run.core;

import com.suray.basic.wcs.utils.Coord;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

/**
 * 故障信息
 */
@Data
public class ErrorDescription extends BaseInfo {

    /**
     * 故障原因
     */
    private String errorMessage;

    /**
     * 故障时间
     */
    private Date errorTime;

    /**
     * 故障恢复时间
     */
    private Date endErrorTime;

    /**
     * 故障地点
     */
    private String errorLocation;

    /**
     * 故障任务
     */
    private String errorTaskId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        ErrorDescription that = (ErrorDescription) o;
        return Objects.equals(errorMessage, that.errorMessage) &&
                Objects.equals(errorTime, that.errorTime) &&
                Objects.equals(endErrorTime, that.endErrorTime) &&
                Objects.equals(errorLocation, that.errorLocation) &&
                Objects.equals(errorTaskId, that.errorTaskId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), errorMessage, errorTime, endErrorTime, errorLocation, errorTaskId);
    }
}
